using AltNetHispano.Vale.DataAnnotations.Tests.SampleEntities;
using NUnit.Framework;
using SharpTestsEx;

namespace AltNetHispano.Vale.DataAnnotations.Tests
{
	[TestFixture]
	public class PolimorphicTests
	{
		[Test]
		public void CanGetInvalidMessagesForPersonProperties()
		{
			var validator = new Validator();
			validator.RegisterDataAnnotationsConstraints<Person>();

			var contact = new Contact {Name = null};

			validator.GetInvalidMessages(contact)
				.Should().Contain("Name is required.");
		}
	}
}